// C03:3.14:typecast.cpp -- forcing type changes
#include <iostream>

int main(void)
{
    using namespace std;
    int auks, bats, coots;

    // the following staement adds the values as double.
    // then converts the result to int
    auks  = 19.9 + 11.99;
    
    // these statement add values as int
    bats = (int)19.99 + (int)11.99;   // old C syntax
    coots = int(19.99) + int(11.99);    // new C++ syntax
    cout << "auks = " << auks << ", bats = " << bats;
    cout << ", coots = " << coots << endl;

    char ch = 'Z';
    cout << "The code for " << ch << " is ";    // print as char
    cout << int(ch) << endl;                    // print as int
    cout << "Yes, the code is ";
    cout << static_cast<int>(ch) << endl;    // using static_cast
}